import ajax from './ajax'
var root = process.env.API_HOST

export default class API {

  // 管理员登录
  static reqUserLogin (params) {
    return ajax(root + '/login/userLogin', params)
  }

  // 更换广告图
  static reqUpdateShufflingImg (params) {
    return ajax(root + '/shufflingImg/updateShufflingImg', params, 'POST')
  }
  // 广告图编号
  static reqRelationGoods (params) {
    return ajax(root + '/shufflingImg/relationGoods', params)
  }
  // 查看广告图列表
  static reqShufflingImgList (params) {
    return ajax(root + '/shufflingImg/shufflingImgList', params)
  }

  // 查看所有商品列表
  static reqGetAllGoodsCategory (params) {
    return ajax(root + '/goodsCategory/getAllGoodsCategory', params)
  }
  // 查看商品类目列表
  static reqSelectGoodsCategoryList (params) {
    return ajax(root + '/goodsCategory/selectGoodsCategoryList', params)
  }
  // 新增类目
  static reqAddGoodsCategory (params) {
    return ajax(root + '/goodsCategory/addGoodsCategory', params, 'POST')
  }
  // 修改类目
  static reqUpdateGoodsCategory (params) {
    return ajax(root + '/goodsCategory/updateGoodsCategory', params, 'POST')
  }

  // 新增或者修改商品
  static reqAddOrUpdateGoods (params) {
    return ajax(root + '/goods/addOrUpdateGoods', params, 'POST')
  }
  // 查看商品详细信息
  static reqSelectGoodsInfo (params) {
    return ajax(root + '/goods/selectGoodsInfo', params)
  }
  // 条件查询商品列表
  static reqConditionGoodsInfos (params) {
    return ajax(root + '/goods/conditionGoodsInfos', params)
  }
  // 条件查询商品列表
  static reqGetUnit (params) {
    return ajax(root + '/goods/getUnit', params)
  }

  // 加入购物车
  static reqAddCoupon (params) {
    return ajax(root + '/coupon/addCoupon', params)
  }
  // 查看优惠券详细信息
  static reqDetailCoupon (params) {
    return ajax(root + '/coupon/detailCoupon', params)
  }
  // 修改优惠券
  static reqUpdateCoupon (params) {
    return ajax(root + '/coupon/updateCoupon', params)
  }
  // 删除优惠券
  static reqDelCoupon (params) {
    return ajax(root + '/coupon/delCoupon', params)
  }
  // 查看优惠券列表
  static reqCouponAll (params) {
    return ajax(root + '/coupon/couponAll', params)
  }

  // 条件查询订单列表
  static reqConditionOrderInfos (params) {
    return ajax(root + '/order/conditionOrderInfos', params)
  }
  // 查看订单详细信息
  static reqOrderInfoDetail (params) {
    return ajax(root + '/order/orderInfoDetail', params)
  }
  // 查看订单详细信息
  static reqOrderDetail (params) {
    return ajax(root + '/order/orderDetail', params)
  }
  // 确认发货
  static reqDeliveGoods (params) {
    return ajax(root + '/order/deliveGoods', params)
  }
  // 确认付款
  static reqPayment (params) {
    return ajax(root + '/order/payment', params)
  }
  // 查看售后订单列表
  static reqAfterSale (params) {
    return ajax(root + '/order/afterSale', params)
  }
  // 查看退款原因
  static reqRefundReason (params) {
    return ajax(root + '/order/refundReason', params)
  }
  // 处理退款申请
  static reqManageRefundRequest (params) {
    return ajax(root + '/order/manageRefundRequest', params)
  }
  // 客服添加订单
  static reqAppendOrder (params) {
    return ajax(root + '/service/appendOrder', params)
  }

  // 未完待续...
  //查看用户列表
  static reqUserList (params) {
    return ajax(root + '/user/userList', params)
  }
  //用户订单列表
  static reqUserOrderList (params) {
    return ajax(root + '/user/userOrderList', params)
  }
  //查看订单详细信息
  static reqOrderDetail (params) {
    return ajax(root + '/order/orderDetail', params)
  }
  //确认发货
  static reqDeliveGoods (params) {
    return ajax(root + '/order/deliveGoods', params)
  }

  //查看佣金明细列表
  static reqIncomeDetailList (params) {
    return ajax(root + '/incomeDetail/incomeDetailList', params)
  }
  //查看合伙人列表
  static reqPartnerList (params) {
    return ajax(root + '/partnerInfo/partnerList', params)
  }
  //查看意见反馈列表
  static reqRemarkInfoList (params) {
    return ajax(root + '/remarkInfo/remarkInfoList', params)
  }

  //分销设置修改名称和开发层数
  static reqUpdateName (params) {
    return ajax(root + '/setUp/updateName', params)
  }

  //分销设置修改分销利率
  static reqUpdateDistribute (params) {
    return ajax(root + '/setUp/updateDistribute', params)
  }
    //查看分销设置及分销利率
    static reqLookName (params) {
      return ajax(root + '/setUp/selectSets', params)
    }

  // 获取邀请码
  static reqInvitationCode (params) {
    return ajax(root + '/service/getInvitationCode', params)
  }
}
